module.exports = function ($scope, $modal, $resource, $modalInstance, para, no_pass) {

	init();
	function init(){
		$scope.no_pass = no_pass;
		if(!no_pass){
			$scope.reason = para.no_pass_reason;
		}
	}

	//通过
	$scope.ok = function (){
		if(!$scope.reason){
			alert('请填写未通过原因');
			return;
		}
		para.no_pass_reason = $scope.reason;
		$resource('/api/ac/dsc/checkEnterpriseService/setCheckResult', {}, {}).save(para, function(res){
			if(res.errcode === 0){
				$modalInstance.close();
			}else{
				alert(res.errmsg);
			}
		});
	};

	//取消
    $scope.cancel = function () {
        $modalInstance.dismiss('cancel');
    };


};